package com.trimps.wifi.service.impl;

import java.util.List;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import com.trimps.wifi.mapper.TogertherDataMapper;
import com.trimps.wifi.pojo.FlowData;
import com.trimps.wifi.service.TogertherDataService;

@Service("TogertherDataService")
public class TogertherDataServiceImpl implements TogertherDataService {
	@Autowired
	private TogertherDataMapper togertherDataMapper;	

	@Override
    public List<FlowData> getTogertherListByKeyword(String macType,String deviceMac, String deviceNo, String startTime, String endTime, int currentPage, int rowPerPage) {
        int start = 0;
        if (rowPerPage == 0) {
            rowPerPage = 15;
        }
        if (currentPage != 0) {
            start = (currentPage - 1) * rowPerPage;
        }
        return this.togertherDataMapper.getTogertherListByKeyword(macType,deviceMac,deviceNo,startTime,endTime, start, rowPerPage);
    }

    @Override
    public int getTogertherListCountByKeyword(String macType,String deviceMac, String deviceNo, String startTime, String endTime) {
        return this.togertherDataMapper.getTogertherListCountByKeyword(macType,deviceMac,deviceNo,startTime,endTime);
    }

}
